import { createRouter, createWebHashHistory } from "vue-router";
import routes from "./routes";

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
});

router.beforeEach(async (to, from, next) => {
  if (to.path === "/login") {
    sessionStorage.clear();
  }
  if (to.path === "/reportDetails") {
    let ele = document.getElementById("image_class_logo");
    ele.style = "display: none;";
  } else {
    let ele = document.getElementById("image_class_logo");
    ele.style = "display: block;";
  }
  next();
});
export default router;
